import reshandler from 'services/response-handler'
/*
 * 品论查询
 */
function makeData(response) {
  let val = response.comment
  let commentArr = []
  val.member['publishDate'] = val.commentDatetime
  val.comments&&val.comments.forEach(res=>{
    res.member['publishDate']= res.commentDatetime
    commentArr.push(res)
  })
  return {
    commentData:val,
    commentList:commentArr
  }
}
export default function (params, success, fail) {
  // request 
  params = Object.assign({}, params, {
    methodName: "QuerySpaceComment",
  })

  // invoke
  this.$.get(params)
    .then(reshandler.success(success, fail, makeData), reshandler.error(fail))
}
